package org.fintool.common;

import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;


public class PropertyUtil {
	 private static final String BUNDLE_NAME = "org.fintool.common.Resource";
	 
     private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME,Locale.US);
     
     
     public static String getValue(String key){
         try{
               return RESOURCE_BUNDLE.getString(key);
         }catch(MissingResourceException mex){
               return "";
         }catch(Exception ex){
               return "NOT FOUND";
         }
   }
     public final static  boolean isDay(){
    	 boolean isDay=true;
     
     String modeOverRide=PropertyUtil.getValue(Constants.DEAULT_MODE_OVERRIDE);
		
		String mode=PropertyUtil.getValue(Constants.MODE);
	
		
		
		if(modeOverRide.equalsIgnoreCase("t")||modeOverRide.equalsIgnoreCase("y")){
			isDay=true;
			
		}
		else{
			if(mode.equalsIgnoreCase("s")){
				isDay=false;
				
			}else{
				isDay=true;
			}
			
			
			
		}
		
		return isDay;
		
     }
		
     
     //Test main
     
     public static void main(String[] args) {
    	 System.out.println(getValue("BASE_FILE_PATH"));
		
	}
}
